ALMaSS  1.0
The Animal, Landscape and Man Simulation System
CfgFloat Class Reference

Double configurator entry class. More...

#include <configurator.h>

Inheritance diagram for CfgFloat:
CfgBase

Public Member Functions

 CfgFloat (const char *a_key, CfgSecureLevel a_level, double a_defval)
 
 CfgFloat (const char *a_key, CfgSecureLevel a_level, double a_defval, double a_min, double a_max)
 Constructor with max min checking enabled. More...
 
double value (void)
 
virtual void set (double a_newval)
 
virtual CfgType gettype (void)
 
- Public Member Functions inherited from CfgBase
 CfgBase (const char *a_key, CfgSecureLevel a_level)
 
virtual ~CfgBase (void)
 
const string getkey (void)
 
CfgSecureLevel getlevel (void)
 

Protected Attributes

double m_float
 
double m_min
 
double m_max
 
- Protected Attributes inherited from CfgBase
string m_key
 
CfgSecureLevel m_level
 
bool m_rangetest
 

Detailed Description

Double configurator entry class.

Constructor & Destructor Documentation

◆ CfgFloat() [1/2]

CfgFloat::CfgFloat ( const char *  a_key,
CfgSecureLevel  a_level,
double  a_defval 
)
121  :CfgBase(a_key, a_level)
122 {
123  m_float = a_defval;
124 }
CfgBase(const char *a_key, CfgSecureLevel a_level)
Definition: configurator.cpp:73
double m_float
Definition: configurator.h:109

References m_float.

◆ CfgFloat() [2/2]

CfgFloat::CfgFloat ( const char *  a_key,
CfgSecureLevel  a_level,
double  a_defval,
double  a_min,
double  a_max 
)

Constructor with max min checking enabled.

126  : CfgBase(a_key, a_level)
127 {
128  m_min = a_min;
129  m_max = a_max;
130  m_rangetest = true;
131  set(a_defval);
132 }
bool m_rangetest
Definition: configurator.h:73
virtual void set(double a_newval)
Definition: configurator.cpp:134
double m_min
Definition: configurator.h:110
double m_max
Definition: configurator.h:111

References m_max, m_min, CfgBase::m_rangetest, and set().

Member Function Documentation

◆ gettype()

virtual CfgType CfgFloat::gettype ( void  )
inlinevirtual

Reimplemented from CfgBase.

120 { return CFG_FLOAT; }
@ CFG_FLOAT
Definition: configurator.h:54

References CFG_FLOAT.

◆ set()

void CfgFloat::set ( double  a_newval)
virtual
134  {
135  if (m_rangetest) {
136  if ((a_newval<m_min) || (a_newval>m_max))
137  {
138  g_msg->Warn("CfgFloat::set Value out of range: ", a_newval);
139  g_msg->Warn("CfgFloat::set Max allowed: ", m_max);
140  g_msg->Warn("CfgFloat::set Min allowed: ", m_min);
141  }
142  }
143  m_float = a_newval;
144 }
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: maperrormsg.cpp:59
class MapErrorMsg * g_msg
This pointer provides access the to the internal ALMaSS error message system.
Definition: maperrormsg.cpp:41

References g_msg, m_float, m_max, m_min, CfgBase::m_rangetest, and MapErrorMsg::Warn().

Referenced by CfgFloat().

◆ value()

double CfgFloat::value ( void  )
inline
118 { return m_float; }

Referenced by OptimisingFarm::ActualProfit(), Goose_Base::AdjustIntakeRateToSnowDepth(), Rabbit_Population_Manager::AssignStaticVariables(), BeetleBank::BeetleBank(), Landscape::BeetleBankPossible(), Hare_Young::BeginStep(), Hare_Juvenile::BeginStep(), Hare_Male::BeginStep(), Hare_Female::BeginStep(), Rabbit_Warren::CalcDisease(), VegElement::CalcGooseForageResources(), Pond::CalcLarvalFood(), Pond::CalcPondPesticide(), Farm::CattleIsOut(), Farm::CattleIsOutLow(), Farm::CattleOut(), Farm::CattleOutLowGrazing(), Partridge_Chick::ChDeveloping(), Hunter_Population_Manager::CheckDensity(), Rabbit_Population_Manager::CheckForRabbitBreedingConditions(), OptimisingFarm::ChooseDecisionMode(), Partridge_Clutch::ClDeveloping(), AnimalFarm::correctFodderDemand(), CoveyManager::CoveyManager(), Farm::CutOrch(), Orchard::Cutting(), MownGrass::Cutting(), Bembidion_Egg_List::DailyMortality(), Partridge_Chick::DailyMortality(), Partridge_Chick2::DailyMortality(), Partridge_Male::DailyMortality(), Partridge_Female::DailyMortality(), Pesticide::DiffusionFunction(), FarmManager::DistributeFarmerTypes(), Hunter_Population_Manager::DistributeHuntersByRules(), VegElement::DoDevelopment(), BeetleBank::DoDevelopment(), Orchard::DoDevelopment(), OrchardBand::DoDevelopment(), Goose_Population_Manager::DoEmigration(), THare_Population_Manager::DoFirst(), Rabbit_Population_Manager::DoFirst(), Vole_Population_Manager::DoFirst(), Goose_Population_Manager::DoFirst(), Goose_Population_Manager::DoImmigration(), Configurator::DumpSymbols(), FarmManager::FarmManagement(), Partridge_Population_Manager::FillInFoodArray(), Partridge_Female::FIncubating(), OptimisingFarm::findBIs(), FarmManager::FindClosestFarmOpennessProb(), FarmManager::FindClosestFarmOpennessProbNearRoostIsBest(), FarmManager::FindClosestFarmOpennessProbSmallIsBest(), OptimisingFarm::findFertilizer(), OptimisingFarm::findGrossMargin(), FarmManager::FindNeighbours(), Partridge_Female::FLaying(), THare::ForageSquare(), THare::ForageSquareP(), Hare_Female::GeneralOrganoPhosphate(), Hare_Male::GeneralOrganoPhosphate(), Goose_Population_Manager::GetForageLocIndex(), Goose_Population_Manager::GetImmigrationNumbers(), Hunter_Population_Manager::GetNoHuntLocs(), Skylark_Adult::GetVegHindrance(), Hare_Female::GiveBirth(), Goose_Population_Manager::Goose_Population_Manager(), Goose_Population_Manager::GooseFieldForageInfoOutput(), GooseMemoryMap::GooseMemoryMap(), Partridge_Covey::HabitatEvalPoly(), Landscape::hb_Add(), Landscape::hb_MarkTheBresenhamWay(), Heath::Heath(), THare_Population_Manager::Hunting(), THare_Population_Manager::HuntingDifferentiatedBeetleBankArea(), THare_Population_Manager::HuntingGrid(), THare_Population_Manager::Init(), GooseHunter::Init(), Goose_Base::Init(), Goose_Barnacle_Base::Init(), Goose_Greylag_Base::Init(), Goose_Pinkfoot_Base::Init(), Vole_Base::Init(), Bembidion_Population_Manager::Init(), Partridge_Population_Manager::Init(), Vole_Population_Manager::Init(), Rabbit_Warren::InitEvaluation(), Hare_Male::InternalPesticideHandlingAndResponse(), Hare_Female::InternalPesticideHandlingAndResponse(), Rabbit_Juvenile::InternalPesticideHandlingAndResponse(), Rabbit_Male::InternalPesticideHandlingAndResponse(), Rabbit_Female::InternalPesticideHandlingAndResponse(), Hunter::IsTodayAChosenHuntDay(), Landscape::Landscape(), Skylark_Population_Manager::LoadParameters(), Pesticide::MainMapDecay(), Partridge_Covey::ManagerCheckMerge(), Partridge_Covey::ManagerDriftPos(), Partridge_Covey::ManagerRethinkPos(), Marsh::Marsh(), Partridge_Covey::MoveMagicVegToFood(), MownGrass::MownGrass(), NaturalGrassDry::NaturalGrassDry(), NaturalGrassWet::NaturalGrassWet(), Newt_Juvenile::Newt_Juvenile(), Newt_Population_Manager::Newt_Population_Manager(), RodenticidePredators_Population_Manager::NewTerritory(), Partridge_Female::OnClutchMown(), Bembidion_Larvae::OnFarmEvent(), Bembidion_Pupae::OnFarmEvent(), Bembidion_Adult::OnFarmEvent(), Partridge_Clutch::OnFarmEvent(), Partridge_Chick::OnFarmEvent(), Partridge_Chick2::OnFarmEvent(), Partridge_Male::OnFarmEvent(), Partridge_Female::OnFarmEvent(), OptimisingFarm::OptimiseFarm(), OptimisingFarm::optimizeCrops(), PermanentSetaside::PermanentSetaside(), PermPasture::PermPasture(), PermPastureLowYield::PermPastureLowYield(), PermPastureTussocky::PermPastureTussocky(), Pesticide::Pesticide(), Skylark_PreFledgeling::PesticideResponse(), Skylark_Female::PesticideResponse(), Skylark_Male::PesticideResponse(), Skylark_Nestling::PesticideResponse(), Farm::PigsAreOutForced(), Farm::PigsOut(), SkTerritories::PrePolyNQual(), SkTerritories::PreProcessLandscape2(), Partridge_Covey::PressureLimitExceeded(), OptimisingFarm::Prob_multiplier(), Farm::ProductApplication(), Farm::ProductApplication_DateLimited(), Rabbit_Adult::Rabbit_Adult(), Rabbit_Juvenile::Rabbit_Juvenile(), Rabbit_Population_Manager::Rabbit_Population_Manager(), Rabbit_Young::Rabbit_Young(), Newt_Juvenile::ReInit(), Skylark_Male::ReInit(), Skylark_Nestling::ReInit(), RoadsideVerge::RoadsideVerge(), RodenticideManager::RodenticideManager(), Hunter_Population_Manager::RuleSet10Based(), Saltmarsh::Saltmarsh(), Hunter_Population_Manager::SaveFarmHunters(), Newt_Population_Manager::SetFreeLivingMortChance(), RodenticideManager::ShouldPlaceBait(), Skylark_Male::Skylark_Male(), Skylark_Nestling::Skylark_Nestling(), SkTerritories::Split(), Hare_Juvenile::st_Developing(), Hare_Male::st_Developing(), Hare_Female::st_Developing(), Skylark_Clutch::st_Developing(), Skylark_Nestling::st_Developing(), Goose_Base::st_Forage(), Hare_Young::st_Foraging(), Hare_Juvenile::st_Foraging(), Hare_Male::st_Foraging(), Hare_Female::st_Foraging(), Vole_Female::st_GiveBirth(), Rabbit_Female::st_GiveBirth(), Skylark_Female::st_Immigrating(), Vole_Male::st_Infanticide(), Vole_Female::st_Lactating(), Skylark_Female::st_Laying(), GooseHunter::st_OutHunting(), Goose_Barnacle_Base::st_ToRoost(), Goose_Greylag_Base::st_ToRoost(), Goose_Pinkfoot_Base::st_ToRoost(), Rabbit_Warren::st_WarrenBeing(), Goose_Base::StartDay(), Hare_Juvenile::Step(), Hare_Male::Step(), Hare_Female::Step(), THare::THareInit(), Pesticide::Tick(), Rabbit_Warren::UpdateForageInformation(), Hare_Female::UpdateGestation(), Hare_Female::UpdateOestrous(), THare::WasPredated(), WaterBufferZone::WaterBufferZone(), and Goose_Population_Manager::WriteConfig().

Member Data Documentation

◆ m_float

double CfgFloat::m_float
protected

Referenced by CfgFloat(), and set().

◆ m_max

double CfgFloat::m_max
protected

Referenced by CfgFloat(), and set().

◆ m_min

double CfgFloat::m_min
protected

Referenced by CfgFloat(), and set().


The documentation for this class was generated from the following files: